package com.hax2max.control.externalclient;

import com.hax2max.control.FriendStalkerException;
import com.hax2max.model.ExternalData;

public interface IExternalClient {

	/**
	 * Gets data from an external source, adds it 
	 * to the supplied data object
	 * @param p
	 * @return true if success
	 */
	public ExternalData loadData(ExternalData ed);
	
	/**
	 * updates status in external web service 
	 * @param status
	 * @return
	 */
	public boolean updateStatus(ExternalData ed);
	
	/**
	 * Check if user is valid (exists)
	 * @param p
	 * @return
	 */
	public boolean testUserValid();
	
	/**
	 * Change user name and password, 
	 * Exception thrown if login is not successful
	 * @throws FriendStalkerException
	 * @returns a new Client
	 */
	public IExternalClient changeUserAndLogin(String userId, String password) throws FriendStalkerException.IExternalClient;
	
	/**
	 * Possibility to call other method to external SM services
	 * @param method method to be called
	 * @param parameter list of parameters
	 * @return object if method call returns something. Otherwise null
	 * @throws FriendStalkerException
	 */
	
	public Object callOtherMethod(String method, String ...parameter) throws FriendStalkerException.IExternalClient;
}
